package com.itlong.cloud.iot.dao;

import com.itlong.cloud.POJO.VO.common.IotInfoVO;
import com.itlong.cloud.POJO.VO.common.ProjectIotInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      iot内部业务数据访问接口
 * </desc>
 *
 * @createDate 2020/01/08
 */
@Repository
public interface IotInteriorDao {
    /**
     * <desc>
     *      根据设备序列号获取iot信息
     * </desc>
     *
     * @param iotType
     * @return
     * @author Jiaqi.X
     * @createDate 2020/01/08
     */
    List<IotInfoVO> getIotInfosByIotType(@Param("iotType") Integer iotType, @Param("deviceType") Integer deviceType);

    /**
     * <desc>
     *      根据项目id报获取iot项目配置信息
     * </desc>
     *
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2020/01/08
     */
    ProjectIotInfo getProjectIotInfoByProjectId(@Param("projectId") String projectId, @Param("deviceType") Integer deviceType,
                                                @Param("deviceUnique") String deviceUnique);

    /**
     * <desc>
     *      更新设备iot信息
     * </desc>
     *
     * @param deviceId
     * @param secret
     * @param nodeId
     * @return
     * @author Jiaqi.X
     * @createDate 2020/01/09
     */
    Integer updateDeviceIotInfo(@Param("deviceUnique") String deviceUnique, @Param("deviceId") String deviceId, @Param("secret") String secret, @Param("nodeId") String nodeId,
                                @Param("deviceType") Integer deviceType);

    /**
     * <desc>
     *      获取云门禁华为iot密码
     * </desc>
     *
     * @return
     * @author Jiaqi.X
     * @createDate 2020/02/23
     */
    String getEntranceHuaweiDevicePassword(@Param("deviceId") String deviceId);




    /**
     * <desc>
     *      保存设备在线状态变更日志
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/11/24 15:37
     */
    Integer save(Map<String, Object> params);


    /**
     * <desc>
     *      根据设备号获取已知最新状态
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/11/24 15:37
     */
    String getNewTimeDeviceStatus(String deviceName);
}
